package com.ruoyi.service.achievements.impl;

import com.ruoyi.mapper.achievements.AcvDepManageMapper;
import com.ruoyi.service.achievements.AcvDepManageService;
import com.ruoyi.system.domain.SysDept;
import com.ruoyi.util.StringUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;

/**
 * @author zeo
 * @explain 绩效部门管理服务接口实现类
 * @date 2020/8/21 17:08
 */
@Service
public class AcvDepManageServiceImpl implements AcvDepManageService {

    @Autowired
    AcvDepManageMapper acvDepManageMapper;

    @Override
    public List<Map> finDepList(Map map) {
        return acvDepManageMapper.finDepList(map);
    }

    @Override
    public List<Map> findSecondaryDept() {
        return acvDepManageMapper.findSecondaryDept();
    }

    @Override
    public List<Map> findTertiaryDept(int deptId) {
        return acvDepManageMapper.findTertiaryDept(deptId);
    }

    @Override
    public int addDep(String depName, String deptId) {
        return acvDepManageMapper.addDep(depName, deptId);
    }

    @Override
    public Map findDepNameByDeptId(String deptId) {
        return acvDepManageMapper.findDepNameByDeptId(deptId);
    }

    @Override
    public int editDepNameByDeptId(String deptId, String deptName, String twoDeptId) {
        if (!"".equals(twoDeptId)) {
            acvDepManageMapper.editExamineeDept(twoDeptId, deptId);
        }
        return acvDepManageMapper.editDepNameByDeptId(deptId, deptName, twoDeptId);
    }

    @Override
    public List<Map> findAllDept() {
        return acvDepManageMapper.findAllDept();
    }

    @Override
    public List<Map> getJobByTertiaryDeptId(String tertiaryDeptId) {
        return acvDepManageMapper.getJobByTertiaryDeptId(tertiaryDeptId);
    }

    @Override
    public int addJob(Map map) {
        String jobId_I = StringUtil.getUUID();
        map.put("jobId", jobId_I);
        return acvDepManageMapper.addJob(map);
    }

    public Map findJobById(String id) {
        return acvDepManageMapper.findJobById(id);
    }

    @Override
    public int editJob(Map map) {
        return acvDepManageMapper.editJob(map);
    }

    @Override
    public int deleteJobById(String id) {
        return acvDepManageMapper.deleteJobById(id);
    }

    @Override
    public List<Map<String, Object>> findJobList() {
        return acvDepManageMapper.findJobList();
    }

    @Override
    public List<Map<String, Object>> findSuperList() {
        return acvDepManageMapper.findSuperList();
    }

    @Override
    public int addTwoDept(Map map) {
        return acvDepManageMapper.addTwoDept(map);
    }

    @Override
    public int getTwoDeptCountByDeptName(String deptName) {
        return acvDepManageMapper.getTwoDeptCountByDeptName(deptName);
    }

    @Override
    public List<Map> findTwoDeptList() {
        return acvDepManageMapper.findTwoDeptList();
    }
}
